//
//  HospitalCell.m
//  DrProcessTable
//
//  Created by 白岩凇 on 2016/10/3.
//  Copyright © 2016年 白岩凇. All rights reserved.
//

#import "HospitalCell.h"

@interface HospitalCell ()
@property (weak, nonatomic) IBOutlet UILabel *HsptName;
@property (weak, nonatomic) IBOutlet UILabel *HsptCall;
@property (weak, nonatomic) IBOutlet UILabel *HsptAddress;
@property (weak, nonatomic) IBOutlet UILabel *HsptInfo;
@property (weak, nonatomic) IBOutlet UIImageView *HsptImage;

@end

@implementation HospitalCell

//快速获得cell
+ (instancetype)cellWithTableView:(UITableView*)tableView{
    static NSString* ID=@"Hspt_ID";
    HospitalCell* cell=[tableView dequeueReusableCellWithIdentifier:ID];
    if (cell==nil) {
        cell=[[[NSBundle mainBundle]loadNibNamed:NSStringFromClass(self) owner:nil options:nil]lastObject];
    }
    return cell;
}

- (void)setModel:(HsptCellModel *)model{
    _model=model;
    self.HsptName.text=model.HospitalName;
    self.HsptCall.text=model.HospitalCall;
    self.HsptAddress.text=model.HospitalAddress;
    self.HsptInfo.text=model.HospitalInfo;
    self.HsptImage.image=[UIImage imageNamed:model.HospitalImage];
    [self layoutIfNeeded];
    CGFloat need=CGRectGetMaxY(self.HsptInfo.frame);
    model.h=need+10;
}

- (void)awakeFromNib {
    self.HsptInfo.preferredMaxLayoutWidth=[UIScreen mainScreen].bounds.size.width-16;//为了保证计算出来的数值和显示出来的一致
}





@end
